package com.yexiao.cofe.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yexiao.cofe.business.pojo.TemplateParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TemplateParamMapper extends BaseMapper<TemplateParam> {

    @Select("select * from template_param where template_id = #{templateId} and param_value_id = #{paramValueId}")
    TemplateParam selectByTemplateIdAndParamValueId(Integer templateId, Integer paramValueId);

    @Select("select * from template_param where template_id = #{templateId}")
    List<TemplateParam> selectByTemplateId(Integer templateId);

    @Delete("delete from template_param where template_id = #{templateId}")
    void deleteByTemplateId(Integer templateId);
}
